/*--------------------------------*- C++ -*----------------------------------*\ 
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.4.x                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version 2.0;
    format ascii;
    class dictionary;
    location system;
    object snappyHexMeshDict;
}

    castellatedMesh true;
    snap true;
    addLayers true;
    geometry
    {
        body.stl
        {
            type triSurfaceMesh;
            name  body;
        }

        wingps.stl
        {
            type triSurfaceMesh;
            name  wingps;
        }
        wingss.stl
        {
            type triSurfaceMesh;
            name  wingss;
        }
        wingtip.stl
        {
            type triSurfaceMesh;
            name  wingtip;
        }
        wingtipte.stl
        {
            type triSurfaceMesh;
            name  wingtipte;
        }
        wingte.stl
        {
            type triSurfaceMesh;
            name  wingte;
        }
        
        tailps.stl
        {
            type triSurfaceMesh;
            name  tailps;
        }
        tailss.stl
        {
            type triSurfaceMesh;
            name  tailss;
        }
        tailtip.stl
        {
            type triSurfaceMesh;
            name  tailtip;
        }
        tailtipte.stl
        {
            type triSurfaceMesh;
            name  tailtipte;
        }
        tailte.stl
        {
            type triSurfaceMesh;
            name  tailte;
        }

    }

    castellatedMeshControls
    {
        features
        (

            {
                file "body.eMesh";
                level 9;
            }
        
            {
                file "wingps.eMesh";
                level 11;
            }

            {
                file "wingss.eMesh";
                level 11;
            }

            {
                file "wingtip.eMesh";
                level 12;
            }

            {
                file "wingtipte.eMesh";
                level 12;
            }

            {
                file "wingte.eMesh";
                level 12;
            }

            {
                file "tailps.eMesh";
                level 11;
            }

            {
                file "tailss.eMesh";
                level 11;
            }

            {
                file "tailtip.eMesh";
                level 12;
            }

            {
                file "tailtipte.eMesh";
                level 12;
            }

            {
                file "tailte.eMesh";
                level 12;
            }

        );
        refinementSurfaces
        {
            body
            {
                level ( 9 9 );
            }

            wingps
            {
                level ( 10 10 );
            }
            wingss
            {
                level ( 10 10 );
            }
            wingtip
            {
                level ( 12 12 );
            }
            wingtipte
            {
                level ( 12 12);
            }
            wingte
            {
                level ( 12 12 );
            }

            tailps
            {
                level ( 10 10 );
            }
            tailss
            {
                level ( 10 10 );
            }
            tailtip
            {
                level ( 12 12 );
            }
            tailtipte
            {
                level ( 12 12 );
            }
            tailte
            {
                level ( 12 12 );
            }
            
        }

        refinementRegions
        {

        }

        locationInMesh ( -5 1 1 );
        maxLocalCells 10000000;
        maxGlobalCells 200000000;
        minRefinementCells 0;
        nCellsBetweenLevels 3;
        resolveFeatureAngle 10;
        allowFreeStandingZoneFaces true;
        planarAngle 30;
        maxLoadUnbalance 0.10;
    }

    snapControls
    {
        nSolveIter 50;
        nSmoothPatch 3;
        tolerance 2.0;
        nRelaxIter 5;
        nFeatureSnapIter 10;
        implicitFeatureSnap false;
        explicitFeatureSnap true;
        multiRegionFeatureSnap true;
    }

    addLayersControls
    {
        layers
        {
            "body.*|wing.*|tail.*"
            {nSurfaceLayers 5;}
        }

        relativeSizes true;
        expansionRatio 1.3;
        finalLayerThickness 0.4;
        minThickness 0.001;
        nGrow 0;
        featureAngle 180;
        slipFeatureAngle 80;
        nRelaxIter 5;
        nSmoothSurfaceNormals 1;
        nSmoothNormals 3;
        nSmoothThickness 10;
        maxFaceThicknessRatio 0.5;
        maxThicknessToMedialRatio 0.3;
        minMedialAxisAngle 90;
        nBufferCellsNoExtrude 0;
        nLayerIter 50;
        nRelaxedIter 20;
        writeVTK false;
        noErrors false;
        layerRecovery 1;
        growZoneLayers false;
        projectGrownUp 0.0;
    }

    meshQualityControls
    {
        maxNonOrtho 60;
        maxBoundarySkewness 4;
        maxInternalSkewness 4;
        maxConcave 80;
        minFlatness 0.5;
        minVol 1.00E-13;
        minTetQuality 1e-30;
        minArea 0;
        minTwist 0.03;
        minDeterminant 0.01;
        minFaceWeight 0.03;
        minVolRatio 0.01;
        minTriangleTwist -1;
        nSmoothScale 4;
        errorReduction 0.75;
        relaxed {maxNonOrtho 65; minTetQuality -1e30; }
    }

    debug 0;
    mergeTolerance 1E-6;
    autoBlockMesh false;
